#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
#include <string>
#include <vector>
#include <map>
using namespace std;

int main()
{
    int t = 0;
    cin >> t;
    while (t--)
    {
        string flag = "Yes";
        int n = 0;
        cin >> n;
        cerr << "n=" << n << endl;
        vector<string> vs(n, string());
        for (int i = 0;i < n;i++)
        {
            cin >> vs[i];
        }
        int left = 0, right = n - 1;
        while (left <= right)
        {
            cerr << vs[left] << "|" << vs[right] << endl;
            map<char, int> m;
            for (auto& a : vs[left])
            {
                m[a] = 1;
            }
            bool xx = true;
            for (auto& a : vs[right])
            {
                if (m[a] == 1)
                {
                    xx = false;
                    break;
                }
            }
            if (xx)
            {
                flag = "No";
                goto END;
            }
            ++left;
            --right;
        }
    END:
        cerr << flag << endl;
        cout << flag << endl;
    }
    return 0;
}
